package com.bdqn.service.impl;

import com.bdqn.dao.StudentDao;
import com.bdqn.pojo.Book;
import com.bdqn.pojo.Student;
import com.bdqn.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 类名 StudentServiceImpl
 * 描述 TODO
 * 日期 2022/2/14 9:59
 * 创建人 by xfq
 * 项目名称 springbootbook
 */
@Service
public class StudentServiceImpl implements StudentService {

    //dao层资源
    @Autowired
    private StudentDao studentDao;
    //注册
    @Override
    public int addStudent(Student student) {
        return this.studentDao.addStudent(student);
    }
    //登录
//    @Override
//    public boolean sumStu(Student student) {
//        return this.studentDao.sumStu(student);
//    }
    @Override
    public boolean sumStu(Integer sno, Integer password) {
        return this.studentDao.sumStu(sno, password);
    }
    //书籍页面展示
    @Override
    public List<Book> sumBook() {
        return this.studentDao.sumBook();
    }
    //动态条件书籍查询
    @Override
    public List<Book> listBook(String title, String author) {
        return this.studentDao.listBook(title, author);
    }
    //新增书籍
    @Override
    public boolean addBook(Book book) {
        return this.studentDao.addBook(book);
    }
}
